-
Notifications
You must be signed in to change notification settings - Fork 4
UIEXT-3109: Migrate node #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR migrates the Excel Table Writer node to use the modern node parameter framework, replacing the legacy dialog implementation with declarative parameter definitions. The migration introduces type-safe parameter handling and modern UI capabilities while maintaining backward compatibility with existing workflows.
Key changes:
- Replaced legacy
NodeDialogPanewith declarativeNodeParametersclass - Added
@Labelannotations to enums for improved UI presentation - Implemented comprehensive unit tests for the new parameter structure
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| PaperSize.java | Added @Label annotations to enum values for UI display names |
| Orientation.java | Added @Label annotations to enum values for UI display names |
| ExcelTableWriterNodeParameters.java | New file containing declarative node parameter definitions replacing legacy dialog |
| ExcelTableWriterNodeFactory.xml | Removed legacy XML-based node description |
| ExcelTableWriterNodeFactory.java | Updated to implement new dialog and description generation interfaces |
| ExcelTableWriterConfig.java | Changed field visibility from private to package-private for parameter access |
| ExcelEncryptionSettings.java | New reusable parameter widget for Excel encryption configuration |
| ExcelTableWriterNodeParametersTest.java | New test file with snapshot tests and dynamic update validation |
| Test snapshot files | Generated test snapshots for parameter structure validation |
| MANIFEST.MF | Added testing dependency for UI parameter testing |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
7ad3428 to
744b24e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 13 out of 14 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...i3/src/org/knime/ext/poi3/node/io/filehandling/excel/writer/ExcelTableWriterNodeFactory.java
Show resolved
Hide resolved
...nime.ext.poi3/src/org/knime/ext/poi3/node/io/filehandling/excel/ExcelEncryptionSettings.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 14 out of 15 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fa7efc6 to
3f7a02e
Compare
UIEXT-3109 (WebUI-Migration Excel Table Writer)
3f7a02e to
49464ad
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 14 out of 15 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| + "isn't set to append, each sheet name must be unique. The node appends the tables in the order they " | ||
| + "are connected.") | ||
| @SuggestionsProvider(SheetNamesChoicesProvider.class) | ||
| String m_sheetName = "Sheet1"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I restored the old behaviour of using default_${i+1} as default sheet name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Note that this caused two more PRs for knime-base & knime-core-ui)
| @ValueSwitchWidget | ||
| @Persist(configKey = ExcelTableWriterConfig.CFG_SHEET_EXISTS) | ||
| @Layout(SheetsSection.class) | ||
| @Effect(predicate = OutputFileOverwritePolicyIsAppend.class, type = Effect.EffectType.SHOW) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned on Slack, while I am OK with keeping the behavior of this value switch as it was in the old dialog, I prefer your suggested quick fix. Since the If-sheet-exists option does have an effect on the output when the If-exists option is set to Overwrite, it should be shown imho.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please have another look if you are happy with the current implementation.
I'm not 100% sure if the way I coupled the checkbox & the choices widget is the best solution or if there is a more elegant way.
| elementLayout = ElementLayout.HORIZONTAL_SINGLE_LINE) | ||
| @ValueProvider(SheetNamesValueProvider.class) | ||
| @Persistor(SheetNamesPersistor.class) | ||
| @Migrate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does the @Migrate annotation do here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes the behavior explicit (no defaults are loaded), as the @LoadDefaultsForAbsentFields in combination with a custom @Persistor, therefore the syntax check syntax check will warn if there is no explicit @Migrate or @Migrator annotation. In this case, it will turn off the default (as far as I understood it).
| var result = simulator.simulateValueChange("outputFile", "file"); | ||
|
|
||
| // then | ||
| assertThat( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this test fails on Jenkins: https://jenkins.knime.com/blue/organizations/jenkins/knime-excel/detail/PR-4/10/tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed by adding a dependency to org.knime.features.filehandling.core in pom.xml (see discussion in Slack)
| appendend to the last sheet in the name sequence. The original sheet name does not have to be changed. | ||
| </p> <p>This node does not support writing files in the '.xlsm' format, yet appending is supported.</p> | ||
| <p> <i>This node can access a variety of different</i> <a | ||
| href="https://docs.knime.com/2021-06/analytics_platform_file_handling_guide/index.html#analytics-platform-file-systems"><i>file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This URL is outdated (2021-06).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 14 out of 15 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
org.knime.ext.poi3/src/org/knime/ext/poi3/node/io/filehandling/excel/writer/ExcelTableWriterNodeParameters.java:1
- The suppression of SonarQube rule S103 (line length) is applied to a multi-line string literal (FULL_DESCRIPTION). Consider refactoring the description string to use proper line breaks and concatenation instead of suppressing the warning, which would improve code readability.
/*
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 14 out of 15 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (2)
org.knime.ext.poi3/src/org/knime/ext/poi3/node/io/filehandling/excel/writer/ExcelTableWriterNodeParameters.java:1
- Corrected spelling of 'appendend' to 'appended'.
/*
org.knime.ext.poi3/src/org/knime/ext/poi3/node/io/filehandling/excel/writer/ExcelTableWriterNodeParameters.java:1
- Add a comment explaining why this SonarQube rule suppression is necessary. The rule S103 is about line length, so the comment should clarify why long lines are acceptable in this specific FULL_DESCRIPTION string constant.
/*
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
8939b62 to
ed50db0
Compare
UIEXT-3109 (WebUI-Migration Excel Table Writer)
* Needed to run tests on jenkins UIEXT-3109 (WebUI-Migration Excel Table Writer)
UIEXT-3109 (WebUI-Migration Excel Table Writer)
UIEXT-3109 (WebUI-Migration Excel Table Writer)
ed50db0 to
b4cdce9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 15 out of 16 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
org.knime.ext.poi3/src/org/knime/ext/poi3/node/io/filehandling/excel/writer/ExcelTableWriterNodeParameters.java:1
- The SonarQube warning suppression for S103 (line length) should be replaced with proper line breaking in the string literal. Modern Java text blocks support line breaks naturally and don't require this suppression.
/*
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...i3/src/org/knime/ext/poi3/node/io/filehandling/excel/writer/ExcelTableWriterNodeFactory.java
Show resolved
Hide resolved
|



UIEXT-3109 (WebUI-Migration Excel Table Writer)